<?php

/**
 * Jugador form base class.
 *
 * @method Jugador getObject() Returns the current form's model object
 *
 * @package    ehockey
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseJugadorForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'sector'            => new sfWidgetFormChoice(array('choices' => array('Damas' => 'Damas', 'Caballeros' => 'Caballeros'))),
      'habilitado'        => new sfWidgetFormInputCheckbox(),
      'apellido'          => new sfWidgetFormInputText(),
      'nombre'            => new sfWidgetFormInputText(),
      'tipo_documento'    => new sfWidgetFormChoice(array('choices' => array('DNI' => 'DNI', 'C.I' => 'C.I', 'L.C.' => 'L.C.', 'L.E.' => 'L.E.', 'Pasaporte' => 'Pasaporte'))),
      'numero_documento'  => new sfWidgetFormInputText(),
      'fecha_nacimiento'  => new sfWidgetFormDate(),
      'telefono'          => new sfWidgetFormInputText(),
      'fecha_alta'        => new sfWidgetFormDate(),
      'club_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Club'), 'add_empty' => false)),
      'tarjetasVerdes'    => new sfWidgetFormInputText(),
      'tarjetasAmarillas' => new sfWidgetFormInputText(),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'sector'            => new sfValidatorChoice(array('choices' => array(0 => 'Damas', 1 => 'Caballeros'), 'required' => false)),
      'habilitado'        => new sfValidatorBoolean(array('required' => false)),
      'apellido'          => new sfValidatorString(array('max_length' => 255)),
      'nombre'            => new sfValidatorString(array('max_length' => 255)),
      'tipo_documento'    => new sfValidatorChoice(array('choices' => array(0 => 'DNI', 1 => 'C.I', 2 => 'L.C.', 3 => 'L.E.', 4 => 'Pasaporte'), 'required' => false)),
      'numero_documento'  => new sfValidatorString(array('max_length' => 8)),
      'fecha_nacimiento'  => new sfValidatorDate(),
      'telefono'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'fecha_alta'        => new sfValidatorDate(array('required' => false)),
      'club_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Club'))),
      'tarjetasVerdes'    => new sfValidatorInteger(array('required' => false)),
      'tarjetasAmarillas' => new sfValidatorInteger(array('required' => false)),
      'created_at'        => new sfValidatorDateTime(),
      'updated_at'        => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('jugador[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Jugador';
  }

}
